package cn.jbit.processlogutil;


import cn.jbit.exception.CustomerException;
import cn.jbit.util.RespConstant;
import cn.jbit.util.RespPropertiesConfig;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 张在成
 */
@Component
public class LogProcessor {

        @Autowired
        private RespPropertiesConfig respPropertiesConfig;

        public JSONArray checkJsonArray(String jsonStr,String logType) throws CustomerException {

             try {
                  JSONArray jsonData= JSON.parseArray(jsonStr);

                     return  jsonData;
             }catch (Exception e){
                     throw  new CustomerException(RespConstant.CODE_0005,respPropertiesConfig.getMsg(RespConstant.CODE_0005),logType,jsonStr);
             }




        }



}
